#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
    int m = 0;
    int n = 0;
    scanf("%d%d", &n, &m);
    int k = (m > n ? m : n);
    while (1)
    {
        if (m % k == 0 && n % k == 0)
            break;
        k--;
    }
    printf("%d\n", k);
    int t = m * n / k;
    printf("%d", t);
    return 0;
}